package org.arabidopsis.plantCyc;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.util.NoSuchElementException;

import org.biojava.bio.BioException;
import org.biojavax.Namespace;
import org.biojavax.RichObjectFactory;
import org.biojavax.bio.seq.RichSequence;
import org.biojavax.bio.seq.RichSequenceIterator;

public class FastaSeqIterator {
	BufferedReader fastaBufRead;
	RichSequenceIterator rsIter;
	
	FastaSeqIterator(String fileName){
		try {
			fastaBufRead=new BufferedReader(new FileReader(fileName));
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		}
	// a namespace to override that in the file
	Namespace ns = RichObjectFactory.getDefaultNamespace();	
	rsIter=RichSequence.IOTools.readFastaProtein(fastaBufRead,ns);
	}
	
	boolean hasNext() {
		return rsIter.hasNext();
	}
	
	
	RichSequence nextRichSequence() throws NoSuchElementException, BioException{
		return rsIter.nextRichSequence();
	}
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		
	}

}
